package Exception;

public class Main {
    public static void main(String[] args) {
        System.out.println("程序开始");
        NewGenericException newGenericException = new NewGenericException();
        System.out.println(newGenericException instanceof NewGenericException);
        try {
            start2();
        }catch (GenericException e){
            System.out.println(e.getCode());
        }catch (Exception e){
            if (e instanceof NewGenericException){
                System.out.println("all");
            }
            System.out.println(e.getMessage());
        }
        System.out.println("程序结束");
        throw new NullPointerException();
    }
    
    public static void start1() throws RuntimeException{
        throw new GenericException("W11000");
    }
    public static void start2(){
        start1();
    }
}


